#include<iostream>
using namespace std;
#include<vector>
#include<queue>


bool arr[11] = { 0 };

int changeNumber(string &m,string &n)
{
	int number = 0;

	for (int i = 0; i < 8; i++)
	{
		if (m[i] != n[i])
		{
			number++;
		}
	}
	return number;
}

int minMutation(string startGene, string endGene, vector<string>& bank) {

	int length1 = bank.size();

	queue<string> q;

	q.push(startGene);

	int step = 0;

	while (q.size())
	{
		step++;
		int sz = q.size();

		for (int i = 0; i < sz; i++)
		{
			string curGene = q.front();
			q.pop();
			for (int j = 0; j < length1; j++)
			{
				if (!arr[j] && changeNumber(curGene, bank[j]) == 1)
				{
					if (bank[j] == endGene)return step;

					q.push(bank[j]);
					arr[j] = 1;

				}
			}
		}
	}

	return -1;

}

int main()
{

	return 0;
}